package com.group.app.example.controller;

import com.group.app.example.service.ExampleService;
import com.group.app.example.view.ResultView;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@Slf4j
//@RestController
@RequestMapping(value = "/api")
public class ExampleController {

    @Autowired
    ExampleService exampleService;

    @RequestMapping("/test")
    public ResultView<Object> getdata(){
        ResultView<Object> objectResultView = new ResultView<>(200,"success");
        Map<String, Object> getdata = exampleService.getdata();
        objectResultView.setData(getdata);
        return objectResultView;
    }

//    @RequestMapping("/mysql/test")
//    public ResultView<Object> getmysqldata(){
//        ResultView<Object> objectResultView = new ResultView<>(200,"success");
//        Map<String, Object> getdata = exampleService.getmysqldata();
//        objectResultView.setData(getdata);
//        return objectResultView;
//    }
}
